home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus 2004 #2 / Amiga Plus CD - 2004 - No. 02.iso / AmigaPlus / Tools / Anwendungen / glmatrix / source / glmatrix.h < prev    next >
Encoding:
C/C++ Source or Header  |  2004-01-31  |  1.7 KB  |  57 lines

  1. #ifndef __GL_MATRIX__
  2. #define __GL_MATRIX__
  3.  
  4. #include <exec/types.h>
  5. #include <mgl/gl.h>
  6.  
  7. #define GRID_SIZE  70     /* width and height of the arena */
  8. #define GRID_DEPTH 35     /* depth of the arena */
  9. #define WAVE_SIZE  22     /* periodicity of color (brightness) waves */
  10. #define SPLASH_RATIO 0.7  /* ratio of GRID_DEPTH where chars hit the screen */
  11.  
  12. typedef struct {
  13.   GLfloat x, y, z;        /* position of strip */
  14.   GLfloat dx, dy, dz;     /* velocity of strip */
  15.  
  16.   BOOL erasing_p;         /* Whether this strip is on its way out. */
  17.  
  18.   int spinner_glyph;      /* the bottommost glyph -- the feeder */
  19.   GLfloat spinner_y;      /* where on the strip the bottom glyph is */
  20.   GLfloat spinner_speed;  /* how fast the bottom glyph drops */
  21.  
  22.   int glyphs[GRID_SIZE];  /* the other glyphs on the strip, which will be
  23.                              revealed by the dropping spinner.
  24.                              0 means no glyph; negative means "spinner".
  25.                              If non-zero, real value is abs(G)-1. */
  26.  
  27.   int spin_speed;         /* Rotate all spinners every this-many frames */
  28.   int spin_tick;          /* frame counter */
  29.  
  30.   int wave_position;      /* Waves of brightness wash down the strip. */
  31.   int wave_speed;      /* every this-many frames. */
  32.   int wave_tick;      /* frame counter. */
  33.  
  34. } strip;
  35.  
  36. typedef struct {
  37.   BOOL button_down_p;
  38.   GLuint texture;
  39.   int nstrips;
  40.   strip *strips;
  41.   int *glyph_map;
  42.   int nglyphs;
  43.   GLfloat tex_char_width, tex_char_height;
  44.  
  45.   /* auto-tracking direction of view */
  46.   int last_view, target_view;
  47.   GLfloat view_x, view_y;
  48.   int view_steps, view_tick;
  49.   BOOL auto_tracking_p;
  50.  
  51. } matrix_configuration;
  52.  
  53. extern matrix_configuration *mps;
  54. extern void init_matrix(void);
  55. extern void draw_matrix(matrix_configuration *mps);
  56.  
  57. #endif